<%#
  Views that use this partial must supply the following variables:
  thread
  user
%>

<% is_subscribed = !!thread.subscription_for(user) %>
<% sub_string = is_subscribed ? 'unsubscribe' : 'subscribe' %>
&nbsp;
<%= link_to t("commontator.subscription.actions.#{sub_string}"),
            commontator.polymorphic_path([sub_string.to_sym, thread]),
            method: :put,
            id: "commontator-thread-#{thread.id}-#{sub_string}",
            remote: true, class: "btn primary-button", style: "margin-top: 10px;" %>
